import React, { Component } from 'react';
import dynamic from 'dva/dynamic';
import { Route } from 'dva/router';

export default function secKillRoute(app) {

    const SecKill = dynamic({
        app,
        models: () => {
            return [
                import(/* webpackChunkName: "secKillModel" */'../models/secKill/secKillModel'),
            ];
        },
        component: () => import(/* webpackChunkName: "secKill" */'../routes/secKill/secKill'),
    });
    const SecKillClass = dynamic({
        app,
        models: () => {
            return [
                import(/* webpackChunkName: "seckillModel" */'../models/secKill/secKillModel'),
            ];
        },
        component: () => import(/* webpackChunkName: "seckillClass" */'../routes/secKill/secKillClass'),
    });
    const SecKillRemind = dynamic({
        app,
        models: () => {
            return [
                import(/* webpackChunkName: "seckillModel" */'../models/secKill/secKillModel'),
            ];
        },
        component: () => import(/* webpackChunkName: "seckillRemid" */'../routes/secKill/secKillRemind'),
    });


    return (
        [
            <Route key="/secKill" exact path="/secKill/:data" component={SecKill}/>,
            <Route key="/secKillClass" exact path="/secKillClass" component={SecKillClass}/>,
            <Route key="/secKillRemind" exact path="/secKillRemind" component={SecKillRemind}/>,
        ]
    );
}